<?php
class Orthographe_WordCounter_Block_Adminhtml_Renderer_CorrecteurName extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
	
	private $_format = 0;
	
	public function render(Varien_Object $row)
	{
		$data = "";
		// 				Mage::log("NPL - ".get_class($this)." - ID Correcteur ! ".$row->getData($this->getColumn()->getIndex()),Zend_Log::DEBUG);
		$strIDCorrecteur = $row->getData($this->getColumn()->getIndex());
		if(!empty($strIDCorrecteur) && $strIDCorrecteur!="-1") {
				
			$user = Mage::getModel('admin/user')->load($row->getData($this->getColumn()->getIndex()))->getData();
				
			if(Mage::helper('orthographewordcounter')->isAdministrator() && $this->_format==0){
				$data = "<a href='".Mage::helper('adminhtml')->getUrl('adminhtml/permissions_user/edit',
						array('user_id' => $user['user_id']))."'>".
						ucfirst($user['firstname'])." ".ucfirst($user['lastname'])."</a>";
			}else{
				$data = ucfirst($user['firstname'])." ".ucfirst($user['lastname']);
			}
			// 			http://localhost/orthomagento/index.php/admin/permissions_user/edit/user_id/4/key/65f71c676c40afc4917691b4a3ef2075/
				
				
		}else {
			$data = $this->__('Not affected');
		}
		return $data;
	}
	
	public function __construct($format=0){
		$this->_format = $format;
	}
	
}